package com.poly.system.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 站内信消息类型
 * </p>
 *
 * @author QingYu Chen
 * @since 2023-09-18
 */
@Getter
@RequiredArgsConstructor
public enum MessageLevelEnum {

    /**
     * 完成
     */
    success("success","提示"),
    /**
     * 警告
     */
    warning("warning","警告"),
    /**
     * 信息
     */
    info("info","提示"),
    /**
     * 错误
     */
    error("error","错误");



    /**
     * 值
     */
    private final String code;

    /**
     * 标题
     */
    private final String title;



    public static String getTitle(String code) {
        for (MessageLevelEnum item : MessageLevelEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getTitle();
            }
        }
        return "";
    }
}
